package com.ly.mssp.license.client.registry.meta;

import java.util.ArrayList;
import java.util.List;

import com.ly.mssp.license.client.registry.ManifestClient;

public class ManifestMeta {
	
	private String name;
	
	private String tag;
	
	private String architecture;
	
	private String mediaType="application/vnd.docker.distribution.manifest.v2+json";
	
	private int schemaVersion=2;
	
	private List<ManifestChild> manifests =new ArrayList();
	
	//private List<ImageHistory> history=new ArrayList();
	
	//private List<Signature> signatures=new ArrayList();
	
	private ManifestConfig config;
		

	public String getMediaType() {
		return mediaType;
	}

	public void setMediaType(String mediaType) {
		this.mediaType = mediaType;
	}

	
	public ManifestConfig getConfig() {
		return config;
	}

	public void setConfig(ManifestConfig config) {
		this.config = config;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getTag() {
		return tag;
	}

	public void setTag(String tag) {
		this.tag = tag;
	}

	public String getArchitecture() {
		return architecture;
	}

	public void setArchitecture(String architecture) {
		this.architecture = architecture;
	}

	public int getSchemaVersion() {
		return schemaVersion;
	}

	public void setSchemaVersion(int schemaVersion) {
		this.schemaVersion = schemaVersion;
	}

	public ManifestChild[] getManifests () {
		if (manifests.size()>0) {
			return manifests.toArray(new ManifestChild[manifests.size()]);
		}else {
			return null;
		}
	}

	public void addLayer(ManifestChild layer) {
		if (layer!=null) {
			manifests.add(layer);
		}		
	}	

//	public ImageHistory[] getHistory() {
//		if (history.size()>0) {
//			return history.toArray(new ImageHistory[history.size()]);
//		}else {
//			return null;
//		}
//	}
//
//	public void addHistory(ImageHistory history) {
//		if (history!=null) {
//			this.history.add(history);
//		}		
//	}	

//	public Signature[] getSignatures() {
//		if (signatures.size()>0) {
//			return signatures.toArray(new Signature[signatures.size()]);
//		}else {
//			return null;
//		}
//	}
//
//	public void addSignature(Signature signature) {
//		if (signature!=null) {
//			this.signatures.add(signature);
//		}		
//	}	
}
